home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 3.9 KB | 116 lines | [TEXT/MPS ] |
- ;
- ; File: IOIterator.a
- ;
- ; Contains: xxx put contents here xxx
- ;
- ; Version: Technology: xxx put the technology version here xxx
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
- __IOITERATOR__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF FOR_SYSTEM8_PREEMPTIVE THEN
- ; typedefs
- ; typedef UInt32 IteratorDescVersion
-
- ;
- ;###########################################################
- ; How to use the IteratorDescVersion
- ;###########################################################
- ; Each family will define a k<Family>CurrentIteratorDescVersion constant
- ; in its *.i file. The client will check the returned IteratorDescVersion
- ; value against this constant to make sure there's no version mismatch
- ; problem.
- ; Common data structure used by all I/O family iterators
- ;
- IODeviceRef RECORD 0
- contents ds.l 4 ; offset: $0 (0)
- sizeof EQU * ; size: $10 (16)
- ENDR
- ;
- ; a family unique reference number for returned devices.
- ; this is an opaque field, for now, use the name registry Ref value of the
- ; device in question.
- ; The IODeviceRef is unique within a family, NOT unique across the entire I/O name space
- ;
- IOCommonInfo RECORD 0
- ref ds IODeviceRef ; offset: $0 (0)
- versionNumber ds.l 1 ; offset: $10 (16)
- sizeof EQU * ; size: $14 (20)
- ENDR
- ; IteratorDescVersion versionNumber: version number of the family specific IOIteratorData
- ENDIF
- ;
- ;###########################################################
- ; How to copy name registry ref --> IODeviceRef
- ;###########################################################
- ;{
- ; IOCommonInfo DeviceData;
- ; RegEntryRef *anotherReg, *whichDevice;
- ; anotherReg = (RegEntryRef *)&DeviceData;
- ; *anotherReg = *whichDevice;
- ;}
- ;###########################################################
- ; How to define a family specific IOIteratorData structure
- ;###########################################################
- ; struct <FamilyName>IOIteratorData
- ; {
- ; IOCommonInfo IOCI;
- ; // common data for all families
- ; f1, // Individual family specific data
- ; f2,
- ; etc...
- ; };
- ; Example 1: (A possible implementation for the SCSI iterator)
- ; struct SCSIIOIteratorData
- ; {
- ; IOCommonInfo IOCI;
- ; // common data for all families
- ; UInt32 BusID;
- ; UInt32 TargetID;
- ; UInt32 LUN;
- ; };
- ;###########################################################
- ; How to define a family specific iterator function
- ;###########################################################
- ;OSStatus <FamilyName><IterationSpecification>GetDeviceData
- ; ( ItemCount requestItemCount,
- ; FamilyIteratorData *(&<FamilyName>IOIteratorDataArray[requestItemCount]),
- ; ItemCount *totalItemCountPtr );
- ;
- ; For returning ALL devices that the family have access to
- ; OSStatus <FamilyName><IterationSpecification>GetDeviceData
- ; ( UInt32 familySpecificParam,
- ; ItemCount requestItemCount,
- ; FamilyIteratorData *(&<FamilyName>IOIteratorDataArray[requestItemCount]),
- ; ItemCount *totalItemCountPtr );
- ;
- ; For returning a subset of devices, filtered by some family specific parameters
- ; EXAMPLES:
- ; OSStatus SCSIGetDeviceData
- ; ( ItemCount requestItemCount,
- ; ItemCount *totalItemCountPtr,
- ; SCSIIteratorData *(&SCSIIOIteratorDataArray[requestItemCount]));
- ; To get all scsi devices
- ; OSStatus SCSIBusGetDeviceData
- ; ( UInt32 BusID,
- ; ItemCount requestItemCount,
- ; ItemCount *totalItemCountPtr,
- ; SCSIIteratorData *(&SCSIIOIteratorDataArray[requestItemCount]));
- ; To get all scsi devices that matches the input BusID
- ;
- ENDIF ; __IOITERATOR__
-
-